/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package myfx.component;

import javafx.scene.Group;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.RectangleBuilder;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextBuilder;

/**
 *
 * @author Administrator
 */
public class MyCard extends Group{
    private Text titleText;


    private Rectangle titleR;
    private Rectangle contR;
    private int width;
    private int height;
    public MyCard(int width,int height,String title,Color contColor){
        this.width=width;
        this.height=height;
        
        titleR= RectangleBuilder.create()
                .width(90)
                .height(24)
                .fill(Color.LIGHTPINK)
                .build();
        contR=RectangleBuilder.create()
                .width(this.width)
                .height(this.height)
                .fill(contColor)
                .stroke(Color.LIGHTGRAY)
                .build();
        titleText= TextBuilder.create()
                .text(title)
                .font(new Font(14))
                .build();
        this.getChildren().add(titleR);
        this.getChildren().add(titleText);
        this.getChildren().add(contR);
        contR.setTranslateY(24);
        titleText.setTranslateX(8);
        titleText.setTranslateY(17);
    }
    
    public Text getTitleText() {
        return titleText;
    }

    public Rectangle getTitleR() {
        return titleR;
    }

    public Rectangle getContR() {
        return contR;
    }
}
